package com.zgcs.sequence.net.in;

public class JoinRoomPackage extends InPackage {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1226939046031468631L;
	
	public static final int STATE_ROOM_READY = 0;
	public static final int STATE_ROOM_GAMING = 1;
	public static final int STATE_ROOM_OVER_ONCE = 2;
	

	int result;
	int roomID;
	int roomState;
	int userID;
	String userNickname;
	String msg;

	public JoinRoomPackage(String result) {
		super(result);
	}

	@Override
	public void parserSelf() {
		result = Integer.parseInt(resultSpl[2]);
		if (result == RESULT_SUCESS) {
			roomID = Integer.parseInt(resultSpl[3]);
			roomState = Integer.parseInt(resultSpl[4]);
			userID = Integer.parseInt(resultSpl[5]);
			userNickname = resultSpl[6];
			msg = resultSpl[7];
		}
	}

	public int getResult() {
		return result;
	}

	public void setResult(int result) {
		this.result = result;
	}

	public int getRoomID() {
		return roomID;
	}

	public void setRoomID(int roomID) {
		this.roomID = roomID;
	}

	public int getRoomState() {
		return roomState;
	}

	public void setRoomState(int roomState) {
		this.roomState = roomState;
	}

	public int getUserID() {
		return userID;
	}

	public void setUserID(int userID) {
		this.userID = userID;
	}

	public String getUserNickname() {
		return userNickname;
	}

	public void setUserNickname(String userNickname) {
		this.userNickname = userNickname;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

}
